home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / BSD #includes / sys / sys⁄socket.h < prev    next >
Encoding:
Text File  |  1992-09-04  |  8.9 KB  |  127 lines  |  [TEXT/UNIX]

  1. /*
  2.  * Copyright (c) 1982,1985,1986,1988 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)socket.h    7.13 (Berkeley) 4/20/91
  34.  */
  35.  
  36. /*
  37.  * Definitions related to sockets: types, address families, options.
  38.  */
  39.  
  40. /*
  41.  * Types
  42.  */
  43. #define    SOCK_STREAM    1        /* stream socket */
  44. #define    SOCK_DGRAM    2        /* datagram socket */
  45. #define    SOCK_RAW    3        /* raw-protocol interface */
  46. #define    SOCK_RDM    4        /* reliably-delivered message */
  47. #define    SOCK_SEQPACKET    5        /* sequenced packet stream */
  48.  
  49. /*
  50.  * Option flags per-socket.
  51.  */
  52. #define    SO_DEBUG    0x0001        /* turn on debugging info recording */
  53. #define    SO_ACCEPTCONN    0x0002        /* socket has had listen() */
  54. #define    SO_REUSEADDR    0x0004        /* allow local address reuse */
  55. #define    SO_KEEPALIVE    0x0008        /* keep connections alive */
  56. #define    SO_DONTROUTE    0x0010        /* just use interface addresses */
  57. #define    SO_BROADCAST    0x0020        /* permit sending of broadcast msgs */
  58. #define    SO_USELOOPBACK    0x0040        /* bypass hardware when possible */
  59. #define    SO_LINGER    0x0080        /* linger on close if data present */
  60. #define    SO_OOBINLINE    0x0100        /* leave received OOB data in line */
  61.  
  62. /*
  63.  * Additional options, not kept in so_options.
  64.  */
  65. #define SO_SNDBUF    0x1001        /* send buffer size */
  66. #define SO_RCVBUF    0x1002        /* receive buffer size */
  67. #define SO_SNDLOWAT    0x1003        /* send low-water mark */
  68. #define SO_RCVLOWAT    0x1004        /* receive low-water mark */
  69. #define SO_SNDTIMEO    0x1005        /* send timeout */
  70. #define SO_RCVTIMEO    0x1006        /* receive timeout */
  71. #define    SO_ERROR    0x1007        /* get error status and clear */
  72. #define    SO_TYPE        0x1008        /* get socket type */
  73.  
  74. /*
  75.  * Structure used for manipulating linger option.
  76.  */
  77. struct    linger {
  78.     int    l_onoff;        /* option on/off */
  79.     int    l_linger;        /* linger time */
  80. };
  81.  
  82. /*
  83.  * Level number for (get/set)sockopt() to apply to socket itself.
  84.  */
  85. #define    SOL_SOCKET    0xffff        /* options for socket level */
  86.  
  87. /*
  88.  * Address families.
  89.  */
  90. #define    AF_UNSPEC    0        /* unspecified */
  91. #define    AF_UNIX        1        /* local to host (pipes, portals) */
  92. #define    AF_INET        2        /* internetwork: UDP, TCP, etc. */
  93. #define    AF_IMPLINK    3        /* arpanet imp addresses */
  94. #define    AF_PUP        4        /* pup protocols: e.g. BSP */
  95. #define    AF_CHAOS    5        /* mit CHAOS protocols */
  96. #define    AF_NS        6        /* XEROX NS protocols */
  97. #define    AF_ISO        7        /* ISO protocols */
  98. #define    AF_OSI        AF_ISO
  99. #define    AF_ECMA        8        /* european computer manufacturers */
  100. #define    AF_DATAKIT    9        /* datakit protocols */
  101. #define    AF_CCITT    10        /* CCITT protocols, X.25 etc */
  102. #define    AF_SNA        11        /* IBM SNA */
  103. #define AF_DECnet    12        /* DECnet */
  104. #define AF_DLI        13        /* DEC Direct data link interface */
  105. #define AF_LAT        14        /* LAT */
  106. #define    AF_HYLINK    15        /* NSC Hyperchannel */
  107. #define    AF_APPLETALK    16        /* Apple Talk */
  108. #define    AF_ROUTE    17        /* Internal Routing Protocol */
  109. #define    AF_LINK        18        /* Link layer interface */
  110. #define    pseudo_AF_XTP    19        /* eXpress Transfer Protocol (no AF) */
  111.  
  112. #define    AF_MAX        20
  113.  
  114. /*
  115.  * Structure uct sockaddr *, int *));
  116. int    recvmsg __P((int, struct msghdr *, int));
  117. int    send __P((int, const void *, int, int));
  118. int    sendto __P((int, const void *, int, int, const struct sockaddr *, int));
  119. int    sendmsg __P((int, const struct msghdr *, int));
  120. int    setsockopt __P((int, int, int, const void *, int));
  121. int    shutdown __P((int, int));
  122. int    socket __P((int, int, int));
  123. int    socketpair __P((int, int, int, int *));
  124. __END_DECLS
  125.  
  126. #endif    /* !KERNEL */
  127.